﻿<local:DocumentBase x:Class="WPFExcelReport.JLTHLSTA"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
        xmlns:wep="clr-namespace:WPFExcelReport"   
         Loaded="Window_Loaded" 
     >
    <local:DocumentBase.Resources>
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="1*" /> 
        </Grid.RowDefinitions>
        
        <StackPanel Grid.Row="0">
            <WrapPanel >
                <Label Content="生产交期从"   HorizontalAlignment="Left" 
                       Name="label1"    FontSize="16" />
                <DatePicker    Margin="0,2,0,0" Name="FROM_DN_DATE" VerticalAlignment="Top" Panel.ZIndex="1"
                                    SelectedDateChanged ="FROM_DN_DATE_SelectedDateChanged" Width="113" />
                <Label Content="至"  HorizontalAlignment="Left" Margin="10,5,0,0" Name="label2"   FontSize="16" />
                <DatePicker  HorizontalAlignment="Left" Margin="0,2,0,0" Name="END_DN_DATE"  Panel.ZIndex="2"
                                    SelectedDateChanged ="END_DN_DATE_SelectedDateChanged" Width="112" />
                <Label   Content="仅查询已输入了生产交期的订单"  Name="label5"   FontSize="16" />
            </WrapPanel>
            <WrapPanel  >
                <Label Content="业务员下单日期从"  HorizontalAlignment="Left" Name="label3" VerticalAlignment="Top" FontSize="16" />
                <DatePicker  HorizontalAlignment="Left" Margin="0,2,0,0" Name="FROM_DATE" VerticalAlignment="Top" Panel.ZIndex="3"
                                    SelectedDateChanged ="FROM_DATE_SelectedDateChanged" Width="113" />
                <Label Content="至"  HorizontalAlignment="Left" Margin="10,5,0,0" Name="label4" VerticalAlignment="Top"  FontSize="16" />
                <DatePicker Height="25" HorizontalAlignment="Left" Margin="0,2,0,0" Name="END_DATE" VerticalAlignment="Top" Panel.ZIndex="4"
                                    SelectedDateChanged ="END_DATE_SelectedDateChanged" Width="112" />
                <Button Content="查询订单"  Margin="10,0,0,0"  Name="btnQuery"  Panel.ZIndex="5"
                        Click="btnQuery_Click"/>
                <Button Content="导出订单"  Margin="10,0,0,0"  Name="btnEXCEL" Panel.ZIndex="6"
                        Click="btnEXCEL_Click"/>
            </WrapPanel>
        </StackPanel>  
                <DataGrid Grid.Row="1"
                    CanUserReorderColumns="True"  
          CanUserResizeRows="True" CanUserSortColumns="True"
            AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                 
                 FontSize="11"
                  EnableColumnVirtualization="True"  
                  ScrollViewer.HorizontalScrollBarVisibility="Auto"
                  ScrollViewer.VerticalScrollBarVisibility="Auto"
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                               IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                               ItemsSource="{Binding}" x:Name="MasterDg" 
                              >
                    <!--STAFF	KDKNAME	NEWQTY TOTQTY	FREQTY	CREQTY	NORQTY	ONCEQTY	NORRATE	ONCERATE-->
                    <DataGrid.Columns>
                        <DataGridTextColumn Binding="{Binding Path=STAFF}" Header="业务员" Width="SizeToCells" MinWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=KDKNAME}" Header="客户" Width="SizeToCells" MinWidth="60" />
                        <DataGridTextColumn Binding="{Binding Path=NEWQTY}" Header="新样只数" Width="SizeToCells" MinWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=FREQTY}" Header="工厂重打样只数" Width="SizeToCells" MinWidth="70" />
                        <DataGridTextColumn Binding="{Binding Path=CREQTY}" Header="客户重打样只数" Width="SizeToCells" MinWidth="70" />
                        <DataGridTextColumn Binding="{Binding Path=TOTQTY}" Header="累计只数" Width="SizeToCells" MinWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=NORQTY}" Header="准期只数" Width="SizeToCells" MinWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=ONCEQTY}" Header="一次成功只数" Width="SizeToCells" MinWidth="70"  />
                        <DataGridTextColumn Binding="{Binding Path=NORRATE}" Header="准期率" Width="SizeToCells" MinWidth="50" />
                        <DataGridTextColumn Binding="{Binding Path=ONCERATE}" Header="一次成功率" Width="SizeToCells" MinWidth="60" />

                    </DataGrid.Columns>
                </DataGrid  >
           
      
    </Grid>
</local:DocumentBase>
